<?php
class Mproduct extends CI_Model{
	protected $_table="tpt_product";
    protected $_table_2="tpt_catalogue_product";
	public function __construct(){
		parent::__construct();	
		$this->load->database();
	} 

    public function getProductByUrl($url){
        $this->db->select();
        $this->db->from($this->_table.' as a');
        $this->db->join($this->_table_2.' as b','a.cata_id = b.cata_id','left');
        $this->db->where("b.cata_name_url", $url);
        return $this->db->get()->result_array();    
    }
}